home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 2 / ETO Development Tools 2.iso / Essentials / Developer Essentials Nov 90 / Apple II / Apple.II.partition / Utilities / rTutors / part3.3 / rTutor.rez < prev    next >
Encoding:
Text File  |  1990-08-19  |  13.6 KB  |  515 lines  |  [TEXT/pdos]

  1. /* RezIIGS source file for LeMaze */
  2.  
  3. /* this gives use access to the "standard" pre-defined resource types */
  4. #include "Types.rez"
  5.  
  6. /*---------------------- Startup Record ---------------------------*/
  7. resource rToolStartup (1)
  8. {
  9.  $C080,       /* set master SCB to mode640 + fFastPortAware + fUseShadowing */
  10.  {
  11.   3,$0300,      /* misc tools */
  12.   4,$0302,      /* quickdraw */
  13.   5,$0302,      /* desk manager */
  14.   6,$0300,      /* eventMgr */
  15.   11,$0300,      /* int math */
  16.   14,$0301,      /* Window Manager */
  17.   15,$0301,      /* Menu Manager */
  18.   16,$0300,      /* Control Manager */
  19.   18,$0301,      /* QD Aux */
  20.   19,$0300,      /* print manager */
  21.   20,$0301,      /* LineEdit tool set */
  22.   21,$0302,      /* Dialog Manager */
  23.   22,$0300,      /* Scrap manager */
  24.   23,$0301,      /* standard file */
  25.   27,$0301,      /* Font manager */
  26.   28,$0301,      /* list manager */
  27.   34,$0101,      /* text edit */
  28.  }
  29. };
  30.  
  31. /*---------------------- Menus & Menu Bars ---------------------------*/
  32.     /* define the resource id of the menu bar itself */
  33. #define    kMenuBarID1       1
  34.  
  35.     /* define all the menu id's */
  36. #define    kAppleMID   1000
  37. #define    kFileMID    2000
  38. #define    kEditMID    3000
  39.  
  40.     /* now, define the menu item id's */
  41. #define    kAboutBoxIID    1001 /* the "About..." box */
  42.     
  43. #define    kNewItem        2001 /* the "New" item */
  44. #define    kOpenItem       2002 /* the "Open..." item */
  45. #define    kCloseItem       255 /* the "Close" item */
  46. #define    kSaveItem       2004 /* the "Save" item */
  47. #define    kSaveAsItem     2005 /* the "Save As..." item */
  48. #define    kQuitItem       2009 /* the "Quit" item */
  49.       
  50. #define    kUndoItem        250 /* the "Undo" item */
  51. #define    kCutItem         251 /* the "Cut" item */
  52. #define    kCopyItem        252 /* the "Copy" item */
  53. #define    kPasteItem       253 /* the "Paste" item */
  54. #define    kClearItem       254 /* the "Clear" item */
  55. #define    kSelectItem     3001 /* the "Select All" item */
  56. #define    kShowClipItem   3002 /* the "Show Clipboard" item */
  57.       
  58.     /* now, define the menu bar */
  59. resource rMenuBar (kMenuBarID1)
  60. {
  61.     {
  62.         kAppleMID,
  63.         kFileMID,
  64.         kEditMID,
  65.     };
  66. };
  67.  
  68.  
  69. /* lay out the Apple menu */
  70. /* this takes several steps: */
  71. /* 1)  define the menu itself in a resource of type "rMenu" */
  72. /* 2)  define the rPString that will be used for the name of the menu */
  73. /* 3)  define the first item in the menu in a resource of type "rMenuItem" */
  74. /* 4)  define the rPString that will be used for the name of the first item */
  75. /* 5)  repeat steps 3 and 4 for all remaining items in that menu */
  76. /* 6)  repeat steps 1 through 5 for all remaining menus */
  77.     
  78. resource rMenu (kAppleMID, nocrossbank)
  79. {
  80.     kAppleMID,    /* ID of the menu this item belongs to */
  81.     0xA008, /* flags => menu title is a resource, items are resources, menu */
  82.             /* is enabled, XOR highlighting, std menu, caching ok */
  83.     kAppleMID,    /* ref to menu's title */
  84.     { kAboutBoxIID }; /* array of items in this menu (only 1 to start with) */
  85. };
  86.  
  87. resource rPString (kAppleMID, nocrossbank)
  88. {
  89.     "@"                    /* this string is the title of the "Apple" menu */
  90. };
  91.  
  92. /* see IIGS Toolbox Reference, Volume 3, menu item template */
  93. resource rMenuItem (kAboutBoxIID, nocrossbank)
  94. {
  95.     kAboutBoxIID, /* item's ID */
  96.     "",           /* no keyboard equivalent */
  97.     "",           /* no keyboard equivalent (allowed 2, this is the 2nd) */
  98.     0,            /* this item does not have a check mark by it */
  99.     0x8040,       /* title is in a resource, enabled (bit 7=0), */
  100.                   /* dividing line below (bit 6=1)  */
  101.     kAboutBoxIID  /* ref of the item's title */
  102. };
  103.  
  104. resource rPString (kAboutBoxIID, nocrossbank)
  105. {
  106.     "About rTutor" /* used as the title for the "About..." item */
  107. };
  108.  
  109.  
  110.     /* lay out the File menu */
  111.     
  112. resource rMenu (kFileMID, nocrossbank)
  113. {
  114.     kFileMID,  /* ID of the menu this item belongs to */
  115.     0xA008,    /* flags => menu title is a resource, items are resources, */
  116.                /* menu is enabled, don't use XOR highlighting, std menu,  */
  117.                /* caching ok */
  118.     kFileMID,  /* ref to menu's title */
  119.     {          /* array of items in this menu */
  120.         kNewItem,
  121.         kOpenItem,
  122.         kCloseItem,
  123.         kSaveItem,
  124.         kSaveAsItem,
  125.         kQuitItem
  126.     };
  127. };
  128.  
  129. resource rPString (kFileMID, nocrossbank)
  130. {
  131.     " File "   /* this string is the title of the "File" menu */
  132. };
  133.  
  134. resource rMenuItem (kNewItem, nocrossbank)
  135. {
  136.     kNewItem,  /* item's ID */
  137.     "N",       /* keyboard equivalent = "N" */
  138.     "n",       /* or = "n" (either key will work) */
  139.     0,         /* this item does not have a check mark by it */
  140.     0x8000,    /* title is in a resource, enabled (bit 7 = 0)  */
  141.     kNewItem   /* ref of the item's title */
  142. };
  143.  
  144. resource rPString (kNewItem, nocrossbank)
  145. {
  146.     "New"      /* this string is used as the title for the "New" item */
  147. };
  148.  
  149. resource rMenuItem (kOpenItem, nocrossbank)
  150. {
  151.     kOpenItem,
  152.     "O",       /* that's an "OH" on this line, not a "zero" */
  153.     "o",       /* that's an "OH" on this line, not a "zero" */
  154.     0,         /* this one's a "zero" */
  155.     0x8040,    /* the "4" means put a dividing line under this item */
  156.     kOpenItem
  157. };
  158.  
  159. resource rPString (kOpenItem, nocrossbank)
  160. {
  161.     "Open..."
  162. };
  163.  
  164. resource rMenuItem (kCloseItem, nocrossbank)
  165. {
  166.     kCloseItem,
  167.     "W",
  168.     "w",
  169.     0,
  170.     0x8000,
  171.     kCloseItem
  172. };
  173.  
  174. resource rPString (kCloseItem, nocrossbank)
  175. {
  176.     "Close"
  177. };
  178.  
  179. resource rMenuItem (kSaveItem, nocrossbank)
  180. {
  181.     kSaveItem,
  182.     "S",
  183.     "s",
  184.     0,
  185.     0x8000,
  186.     kSaveItem
  187. };
  188.  
  189. resource rPString (kSaveItem, nocrossbank)
  190. {
  191.     "Save"
  192. };
  193.  
  194. resource rMenuItem (kSaveAsItem, nocrossbank)
  195. {
  196.     kSaveAsItem,
  197.     "",        /* no key equivalents for this item */
  198.     "",
  199.     0,
  200.     0x8000,
  201.     kSaveAsItem    
  202. };
  203.  
  204. resource rPString (kSaveAsItem, nocrossbank)
  205. {
  206.     "Save As..."
  207. };
  208.  
  209. resource rMenuItem (kQuitItem, nocrossbank)
  210. {
  211.     kQuitItem,
  212.     "Q",
  213.     "q",
  214.     0,
  215.     0x8000,
  216.     kQuitItem    
  217. };
  218.  
  219. resource rPString (kQuitItem, nocrossbank)
  220. {
  221.     "Quit"
  222. };
  223.  
  224.  
  225.     /* lay out the Edit menu */
  226.     
  227. resource rMenu (kEditMID, nocrossbank)
  228. {
  229.     kEditMID,    /* ID of the menu this item belongs to */
  230.     0xA008,
  231.     kEditMID,    /* ref to menu's title */
  232.     {            /* array of items in this menu */
  233.         kUndoItem,
  234.         kCutItem,
  235.         kCopyItem,
  236.         kPasteItem,
  237.         kClearItem,
  238.         kSelectItem,
  239.         kShowClipItem
  240.     };
  241. };
  242.  
  243. resource rPString (kEditMID, nocrossbank)
  244. {
  245.     " Edit "   /* this string is the title of the "Edit" menu */
  246. };
  247.  
  248. resource rMenuItem (kUndoItem, nocrossbank)
  249. {
  250.     kUndoItem,
  251.     "Z",
  252.     "z",
  253.     0,
  254.     0x8040,
  255.     kUndoItem
  256. };
  257.  
  258. resource rPString (kUndoItem, nocrossbank)
  259. {
  260.     "Undo"
  261. };
  262.  
  263. resource rMenuItem (kCutItem, nocrossbank)
  264. {
  265.     kCutItem,
  266.     "X",
  267.     "x",
  268.     0,
  269.     0x8000,
  270.     kCutItem
  271. };
  272.  
  273. resource rPString (kCutItem, nocrossbank)
  274. {
  275.     "Cut"
  276. };
  277.  
  278. resource rMenuItem (kCopyItem, nocrossbank)
  279. {
  280.     kCopyItem,
  281.     "C",
  282.     "c",
  283.     0,
  284.     0x8000,
  285.     kCopyItem
  286. };
  287.  
  288. resource rPString (kCopyItem, nocrossbank)
  289. {
  290.     "Copy"
  291. };
  292.  
  293. resource rMenuItem (kPasteItem, nocrossbank)
  294. {
  295.     kPasteItem,
  296.     "V",
  297.     "v",
  298.     0,
  299.     0x8000,
  300.     kPasteItem
  301. };
  302.  
  303. resource rPString (kPasteItem, nocrossbank)
  304. {
  305.     "Paste"
  306. };
  307.  
  308. resource rMenuItem (kClearItem, nocrossbank)
  309. {
  310.     kClearItem,
  311.     "",
  312.     "",
  313.     0,
  314.     0x8000,
  315.     kClearItem
  316. };
  317.  
  318. resource rPString (kClearItem, nocrossbank)
  319. {
  320.     "Clear"
  321. };
  322.  
  323. resource rMenuItem (kSelectItem, nocrossbank)
  324. {
  325.     kSelectItem,
  326.     "A",
  327.     "a",
  328.     0,
  329.     0x8040,  /* the "4" means this one has a divider under it */
  330.     kSelectItem
  331. };
  332.  
  333. resource rPString (kSelectItem, nocrossbank)
  334. {
  335.     "Select All"
  336. };
  337.  
  338. resource rMenuItem (kShowClipItem, nocrossbank)
  339. {
  340.     kShowClipItem,
  341.     "",
  342.     "",
  343.     0,
  344.     0x8000,
  345.     kShowClipItem
  346. };
  347.  
  348. resource rPString (kShowClipItem, nocrossbank)
  349. {
  350.     "Show Clipboard"
  351. };
  352.  
  353.  
  354. /*---------------------- Windows --------------------------*/
  355.     /* define the resource ID's for all windows used by this app */
  356. #define myWindowID    2362  /* window's resource ID = 2362 */
  357.  
  358. /* First, we lay out the window itself */
  359. resource rWindParam1 (myWindowID) 
  360. {
  361.  fTitle+fMove+fVis, /* has a title, can be moved, and it is visible */
  362.  myWindowID,         /* resource ID of the title */
  363.  0,                 /* no ref Con needed */
  364.  {0,0,0,0},         /* no zoom box, so we don't care about the zoom rect */
  365.  0,                 /* use std color table for now */
  366.  {0,0},             /* upper left corner of vis rgn = upper left of document */
  367.  {0,0},             /* we don't really have a "document" for this window, so */
  368.                     /* set the data size to zero */
  369.  {0,0},             /* maximum height and width */
  370.  {0,0},             /* don't scroll vertically or horizontally */
  371.  {0,0},             /* no "document", so page size is zero also */
  372.  0,                 /* passed to info bar draw routine - not used here */
  373.  0,                 /* height of info bar - not used here */
  374.  {46,100,176,540},  /* this rect defines the boundaries of the window */
  375.  infront,           /* window comes up in front of other windows */
  376.  0,                 /* set to NIL to avoid bug in NewWindow2 */
  377.  refIsResource*0x0100+resourceToResource /* title string and */
  378.                                          /* control list are resources */
  379. };
  380.  
  381. /* define the title string used by our window */
  382. resource rPstring (myWindowID)
  383. {
  384.     " This came from a resource "
  385. };
  386.  
  387.  
  388.  
  389. /*--------- Alert Window - used as our About Box --------------------*/
  390.  
  391. #define kAboutStr   100 /* define the constant for the About box's string */
  392.  
  393. resource rAlertString (kAboutStr) 
  394. {
  395.  "\$30"                 /* we're using a custom sized box */
  396.  "\$1E\$00"             /* top coord (v1) for custom sized box */
  397.  "\$AA\$00"             /* left coord (h1) for custom sized box */
  398.  "\$B0\$00"             /* bottom coord (v2) for custom sized box */
  399.  "\$D6\$01"             /* right coord for (h2) custom sized box */
  400.  "\$30"                 /* no icon in the window */
  401.  "/"                    /* seperator character */
  402.  TBEndOfLine            /* stick an extra blank line in there */
  403.  TBEndOfLine            /* stick an extra blank line in there */
  404.  TBCenterJust           /* center the text */
  405.  TBStyleBold            /* turn on bold face */
  406.  "rTutor.S16"           /* the first line of text */
  407.  TBEndOfLine            /* mark the end of the line */
  408.  TBEndOfLine            /* stick an extra blank line in there */
  409.  TBStylePlain           /* turn off bold face */
  410.  "The Rez tutorial application"    /* the next line of text */
  411.  TBEndOfLine            /* mark the end of the line */
  412.  TBEndOfLine            /* stick an extra blank line in there */
  413.  TBStylePlain           /* turn off italics */
  414.  TBForeColor            /* set foreground color to... */
  415.  TBColor0               /* ...black */
  416.  "written by:"          /* another line of text */
  417.  TBEndOfLine            /* mark the end of the line */
  418.  TBEndOfLine            /* stick an extra blank line in there */
  419.  TBForeColor            /* set foreground color to... */
  420.  TBColor1               /* ...red */
  421.  "Tim Swihart"          /* the name of this app's author */
  422.  TBEndOfLine            /* mark the end of the line */
  423.  TBEndOfLine            /* stick an extra blank line in there */
  424.  TBEndOfLine            /* stick an extra blank line in there */
  425.  TBStylePlain           /* turn off bold face */
  426.  TBForeColor            /* set foreground color to... */
  427.  TBColor0               /* ...black */
  428.  "Version 3.3"          /* last line of text */
  429.  "/"                    /* "/" is our seperator character */
  430.  "^Thanks, Tim!"     /* "^" means make the button the "default" (tie it to */
  431.                /* the RETURN key) - make the button's text be "Thanks, Tim!" */
  432.  "\$00"        /* make sure the string is NULL terminated since we told */
  433.                /* the window manager we would be using a C string */
  434. };
  435.  
  436.  
  437. /*---------------------- Icons ---------------------------*/
  438. #define kFloorIcon  1   /* for the floor tiles */
  439.  
  440. resource rIcon (kFloorIcon, purgeable1, nocrossbank)
  441. {
  442.         0x8000,        /* bit 15 = 1, so it's a color icon */
  443.         8,             /* height = 8 pixels */
  444.         8,             /* width = 8 pixels */
  445.         $"555555FF"    /* array of pixels in the icon's image */
  446.         $"5EEEE5FF" 
  447.         $"85EE58FF"
  448.         $"A8558AFF" 
  449.         $"A8558AFF"
  450.         $"85EE58FF"
  451.         $"5EEEE5FF"
  452.         $"555555FF", 
  453.         
  454.         $"FFFFFF00"    /* array of pixels in the icon's image */
  455.         $"FFFFFF00" 
  456.         $"FFFFFF00" 
  457.         $"FFFFFF00" 
  458.         $"FFFFFF00"
  459.         $"FFFFFF00"
  460.         $"FFFFFF00"
  461.         $"FFFFFF00";
  462. };
  463.  
  464.  
  465.  
  466.  
  467. /*---------------------- Cursors ---------------------------*/
  468.  
  469. #define rFirstCursor   1
  470.  
  471. resource rCursor (rFirstCursor, fixed)
  472. {
  473.    16,    /* height of rCursor */
  474.     3,    /* width in words */
  475.    {      /* array of hex NUMBERS or integers for cursor */
  476.      0x3FFC,0x3FFC,0x0000,
  477.      0xC03F,0xFC03,0x0000,
  478.      0x3C3C,0x3C0F,0x0000,
  479.      0xC030,0xCC00,0x0000,
  480.      0x0C30,0x0C0C,0x0000,
  481.      0x0CC0,0x030C,0x0000,
  482.      0x00C0,0x0300,0x0000,
  483.      0x0FC0,0x03FC,0x0000,
  484.      0x30C0,0x0303,0x0000,
  485.      0x3330,0x0C33,0x0000,
  486.      0x3330,0x0C33,0x0000,
  487.      0x3030,0x0C03,0x0000,
  488.      0x0F0C,0x30FC,0x0000,
  489.      0x0F03,0xC03C,0x0000,
  490.      0xF300,0x00F3,0x0000,
  491.      0x0F00,0x00FC,0x0000 
  492.    },
  493.    {      /* array for mask */
  494.      0xFFFF,0xFFFF,0x0000,
  495.      0xFFFF,0xFFFF,0x0000,
  496.      0xFFFF,0xFFFF,0x0000,
  497.      0xFFFF,0xFFFF,0x0000,
  498.      0xFFFF,0xFFFF,0x0000,
  499.      0xFFFF,0xFFFF,0x0000,
  500.      0xFFFF,0xFFFF,0x0000,
  501.      0xFFFF,0xFFFF,0x0000,
  502.      0xFFFF,0xFFFF,0x0000,
  503.      0xFFFF,0xFFFF,0x0000,
  504.      0xFFFF,0xFFFF,0x0000,
  505.      0xFFFF,0xFFFF,0x0000,
  506.      0xFFFF,0xFFFF,0x0000,
  507.      0xFFFF,0xFFFF,0x0000,
  508.      0xFFFF,0xFFFF,0x0000,
  509.      0xFFFF,0xFFFF,0x0000 
  510.    },
  511.    8,     /* hot spot Y */
  512.    8,     /* hot spot X */
  513.    1      /* cursor ID  */
  514. };
  515.